package com.lemon.smartsafety.ui.activity.notice;

import android.support.v4.app.Fragment;

import com.lemon.smartsafety.R;
import com.lemon.smartsafetynew.ui.activity.base.BaseSearchFragmentActivity;
import com.lemon.smartsafety.ui.fragment.notice.NoticeSentListFragment;
import com.lemon.smartsafety.utils.common.StringUtils;

/**
 * Created by Cooliean on 16/4/8.
 */
public class NoticeSentListActivity extends BaseSearchFragmentActivity {

    private NoticeSentListFragment mFragment;
    private String mKeyWord = "";


    @Override
    public Fragment getFragment() {
        mFragment = NoticeSentListFragment.newInstance(mKeyWord);
        return mFragment;
    }


    public Fragment getFragment(String text) {
        mFragment = NoticeSentListFragment.newInstance(text);
        return mFragment;
    }


    @Override
    public int getSearchHintRes() {
        return R.string.search_common_hit;
    }

    @Override
    public boolean onQueryTextSubmit(String queryText) {
        mKeyWord = StringUtils.nullValue(queryText);
        replaceFragment(R.id.main_content, getFragment(mKeyWord));
        return super.onQueryTextSubmit(queryText);
    }

    @Override
    protected void initTitle() {
        setBarTitle("已发公告");
    }


}
